package com.xjh.him.netty.codec;

import com.alibaba.fastjson.JSON;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Packet {
    byte command;
    String data;

    public static Packet create(byte command, Object req) {
        return new Packet(command, JSON.toJSONString(req));
    }
}
